<%@page language="java" pageEncoding="UTF-8"%>
<%@page import="org.firecloud.h5fun.model.javabean.*"%>
<%@page import="java.util.List"%>
<%
	@SuppressWarnings("unchecked")
	List<ColumnBean> columns = (List<ColumnBean>) (application.getAttribute("columns"));
	String strActiveColumnId = request.getParameter("activeColumnId");
	byte activeColumnId = 0;
	if (strActiveColumnId != null) {
		activeColumnId = Byte.parseByte(strActiveColumnId);
	}
	UserBean loginUser = (UserBean) session.getAttribute("loginUser");
%>
<div id="head">
	<div id="navbar" class="main-context width-transition">
		<div id="navbar-list">
			<a href="Index"><img id="navbar-image" src="image/logo.png" /></a>
			<%
				if (columns != null) {
					for (ColumnBean column : columns) {
			%>
			<a href="Search?columnId=<%=column.getId()%>"><div
					class="<%=column.getId() == activeColumnId ? "search-arg-cell-active" : ""%>"><%=column.getName()%></div></a>
			<%
				}
				}
			%>
		</div>
		<%
			if (loginUser == null) {
		%>
		<a href="Login">
			<div class="head-login">登录/注册</div>
		</a>
		<%
			} else {
		%>
		<a href="ShowUserInfo?id=<%=loginUser.getId()%>">
			<div class="head-login">
				<%=loginUser.getName()%>
			</div>
		</a>
		<%
			}
		%>
		<div class="search-div">
			<a href="javascript:void();" onclick="location.href='Search?str='+encodeURI($('#str').val());" ><i class="search-div-icon icon-search"></i></a>
				<input type="text" id="str" placeholder="搜索点有意思的吧" class="height-light-input"
				onkeypress="if(event.keyCode==13){location.href='Search?str='+encodeURI(this.value)}" />
		</div>
		<div class="clear-both"></div>
	</div>
</div>
